﻿// Copyright (c)  YISH. All rights reserved.
// Licensed under the MIT License, See License.txt in the project root for license information.

using System;

namespace NSQL.Expressions
{
    public interface IIConstantDateTimeExpression : IDateTimeExpression, IConstantExpression<DateTime>
    {
        
    }
    public class DateTimeExpression : ConstantExpression, IIConstantDateTimeExpression
    {
        public DateTime Value { get; set; }

        public override object ValueOf() => Value;

        private DateTimeExpression(DateTime dateTime) : base(dateTime) => Value = dateTime;

        public static implicit operator DateTimeExpression(DateTime val) => new DateTimeExpression(val);
        protected override IExpression DeepCopy()
        {
            return new DateTimeExpression(Value)
            {
                Tag = Tag
            };
        }
    }
}